/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import bean.PatientBean;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import util.FormatUtil;
import util.HttpUtil;
import util.MakeTempalteStringUtil;
import util.StringConvertUtil;

/**
 *
 * @author wudihua
 */
public class FhirPatientGui extends javax.swing.JFrame {

   // private static final Logger LOGGER = LoggerFactory.getLogger(FhirPatientGui.class);
    private static final Logger logger = LogManager.getLogger(FhirPatientGui.class.getName());
    // public static org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(FhirPatientGui.class);

    
    private PatientBean patientBean;
 
    /**
     * Creates new form FhirPatientGui
     */
    public FhirPatientGui() {
        logger.info("start FhirPatientGui!!!");
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel_patientId = new javax.swing.JLabel();
        jLabel_idCode = new javax.swing.JLabel();
        jTextField_patientId = new javax.swing.JTextField();
        jLabel_idNumber = new javax.swing.JLabel();
        jTextField_idCode = new javax.swing.JTextField();
        jTextField_idNumber = new javax.swing.JTextField();
        jLabel_socialCode = new javax.swing.JLabel();
        jTextField_socialCode = new javax.swing.JTextField();
        jLabel_socialNumber = new javax.swing.JLabel();
        jTextField_socialNumber = new javax.swing.JTextField();
        jLabel_patientName = new javax.swing.JLabel();
        jTextField_patientName = new javax.swing.JTextField();
        jLabel_gender = new javax.swing.JLabel();
        jLabel_TeleValue = new javax.swing.JLabel();
        jTextField_TeleValue = new javax.swing.JTextField();
        jLabel_address = new javax.swing.JLabel();
        jTextField_city = new javax.swing.JTextField();
        jLabel_contactName = new javax.swing.JLabel();
        jTextField_contactName = new javax.swing.JTextField();
        jLabel_relationship = new javax.swing.JLabel();
        jTextField_relationship = new javax.swing.JTextField();
        jLabel_contactTeleValue = new javax.swing.JLabel();
        jTextField_contactTeleValue = new javax.swing.JTextField();
        jLabel_contactGender = new javax.swing.JLabel();
        jComboBox_gender = new javax.swing.JComboBox<>();
        jLabel_state = new javax.swing.JLabel();
        jTextField_state = new javax.swing.JTextField();
        jLabel_city = new javax.swing.JLabel();
        jTextField_district = new javax.swing.JTextField();
        jLabel_district = new javax.swing.JLabel();
        jTextField_line = new javax.swing.JTextField();
        jLabel_line = new javax.swing.JLabel();
        jLabel_postalCode = new javax.swing.JLabel();
        jTextField_postalCode = new javax.swing.JTextField();
        jLabel_birthDate = new javax.swing.JLabel();
        jTextField_birthDateTime = new javax.swing.JTextField();
        jButton_clear = new javax.swing.JButton();
        jComboBox_contactGender = new javax.swing.JComboBox<>();
        jLabel_teleUse = new javax.swing.JLabel();
        jComboBox_teleUse = new javax.swing.JComboBox<>();
        jLabel_TeleType = new javax.swing.JLabel();
        jComboBox_TeleType = new javax.swing.JComboBox<>();
        jLabel_addressUse = new javax.swing.JLabel();
        jComboBox_addressUse = new javax.swing.JComboBox<>();
        jLabel_contactTeleType = new javax.swing.JLabel();
        jComboBox_contactTeleType = new javax.swing.JComboBox<>();
        jLabel7 = new javax.swing.JLabel();
        jButton_create = new javax.swing.JButton();
        jButton_update = new javax.swing.JButton();
        jButton_query = new javax.swing.JButton();
        jButton_queryHistory = new javax.swing.JButton();
        jButton_delete = new javax.swing.JButton();
        jPanel_showXml = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea_showXml = new javax.swing.JTextArea();
        jLabel_url = new javax.swing.JLabel();
        jTextField_url = new javax.swing.JTextField();
        jComboBox_dataType = new javax.swing.JComboBox<>();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("患者");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jLabel_patientId.setText("资源ID：");

        jLabel_idCode.setText("身份证号编码系统标识：");

        jLabel_idNumber.setText("身份证号：");

        jTextField_idCode.setText("2.16.840.1.113883.2.23.1.9.1");

        jTextField_idNumber.setText("110101200301120019");

        jLabel_socialCode.setText("社保卡号编码系统标识：");

        jTextField_socialCode.setText("2.16.840.1.113883.2.23.1.9.2");

        jLabel_socialNumber.setText("社保卡号：");

        jTextField_socialNumber.setText("100000000000");

        jLabel_patientName.setText("患者姓名：");

        jTextField_patientName.setText("刘康");

        jLabel_gender.setText("性别：");

        jLabel_TeleValue.setText("联系方式：");

        jTextField_TeleValue.setText("13800138000");

        jLabel_address.setText("家庭住址：");

        jTextField_city.setText("北京");

        jLabel_contactName.setText("联系人姓名：");

        jTextField_contactName.setText("刘勇");

        jLabel_relationship.setText("联系人与患者关系：");

        jTextField_relationship.setText("parent");

        jLabel_contactTeleValue.setText("联系人联系方式：");

        jTextField_contactTeleValue.setText("13012345678");

        jLabel_contactGender.setText("联系人性别：");

        jComboBox_gender.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "男", "女", "其他", "未知" }));

        jLabel_state.setText("省");

        jLabel_city.setText("市");

        jTextField_district.setText("东城");

        jLabel_district.setText("区");

        jTextField_line.setText("景山前街4号");

        jLabel_line.setText("街道");

        jLabel_postalCode.setText("邮编：");

        jTextField_postalCode.setText("100010");

        jLabel_birthDate.setText("出生日期时间：");

        jTextField_birthDateTime.setText("2003-01-12 09:12:35");
        jTextField_birthDateTime.setToolTipText("");

        jButton_clear.setText("清空");
        jButton_clear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_clearActionPerformed(evt);
            }
        });

        jComboBox_contactGender.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "男", "女", "其他", "未知" }));

        jLabel_teleUse.setText("使用范围：");

        jComboBox_teleUse.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "mobile", "home", "work", "temp", "old" }));

        jLabel_TeleType.setText("联系类型:");

        jComboBox_TeleType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "phone", "fax", "email", "pager", "url", "sms", "other" }));
        jComboBox_TeleType.setAutoscrolls(true);

        jLabel_addressUse.setText("住址使用范围：");

        jComboBox_addressUse.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "home", "work", "temp", "old" }));

        jLabel_contactTeleType.setText("联系人联系类型：");

        jComboBox_contactTeleType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "phone", "fax", "email", "pager", "url", "sms", "other" }));
        jComboBox_contactTeleType.setAutoscrolls(true);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_idCode)
                                        .addComponent(jLabel_patientId)
                                        .addComponent(jLabel_idNumber))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jTextField_idCode, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
                                        .addComponent(jTextField_idNumber)
                                        .addComponent(jTextField_patientId)))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel_socialCode)
                                        .addComponent(jLabel_socialNumber)
                                        .addComponent(jLabel_patientName)
                                        .addComponent(jLabel_gender)
                                        .addComponent(jLabel_TeleValue)
                                        .addComponent(jLabel_birthDate)
                                        .addComponent(jLabel_teleUse)
                                        .addComponent(jLabel_addressUse))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jTextField_socialCode)
                                                .addComponent(jTextField_socialNumber)
                                                .addComponent(jTextField_patientName)
                                                .addComponent(jTextField_TeleValue)
                                                .addComponent(jTextField_birthDateTime)
                                                .addGroup(jPanel1Layout.createSequentialGroup()
                                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                        .addComponent(jComboBox_gender, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jComboBox_teleUse, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addComponent(jComboBox_TeleType, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addGap(0, 0, Short.MAX_VALUE))))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addGap(10, 10, 10)
                                            .addComponent(jComboBox_addressUse, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(142, 142, 142)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel_line)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField_line, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jTextField_state, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel_state)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField_city, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel_city)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField_district, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel_district))
                                    .addComponent(jTextField_postalCode, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel_TeleType)
                            .addComponent(jLabel_contactTeleType))
                        .addContainerGap(23, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jButton_clear)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel_address)
                                    .addComponent(jLabel_contactName)
                                    .addComponent(jLabel_relationship)
                                    .addComponent(jLabel_contactTeleValue)
                                    .addComponent(jLabel_contactGender)
                                    .addComponent(jLabel_postalCode))
                                .addGap(34, 34, 34)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jComboBox_contactGender, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(jTextField_contactTeleValue, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)
                                        .addComponent(jTextField_relationship, javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jTextField_contactName))
                                    .addComponent(jComboBox_contactTeleType, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientId)
                    .addComponent(jTextField_patientId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_idCode)
                    .addComponent(jTextField_idCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_idNumber)
                    .addComponent(jTextField_idNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_socialCode)
                    .addComponent(jTextField_socialCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_socialNumber)
                    .addComponent(jTextField_socialNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_patientName)
                    .addComponent(jTextField_patientName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_gender)
                    .addComponent(jComboBox_gender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_TeleType)
                    .addComponent(jComboBox_TeleType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel_TeleValue)
                    .addComponent(jTextField_TeleValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_teleUse)
                    .addComponent(jComboBox_teleUse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel_birthDate)
                    .addComponent(jTextField_birthDateTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_addressUse)
                    .addComponent(jComboBox_addressUse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel_state)
                        .addComponent(jTextField_state, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jTextField_city, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel_city)
                        .addComponent(jTextField_district, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel_district))
                    .addComponent(jLabel_address))
                .addGap(9, 9, 9)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_line)
                    .addComponent(jTextField_line, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jLabel_postalCode))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField_postalCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel_contactName)
                    .addComponent(jTextField_contactName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_relationship)
                    .addComponent(jTextField_relationship, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_contactTeleType)
                    .addComponent(jComboBox_contactTeleType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_contactTeleValue)
                    .addComponent(jTextField_contactTeleValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel_contactGender)
                    .addComponent(jComboBox_contactGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jButton_clear)
                .addContainerGap(26, Short.MAX_VALUE))
        );

        jButton_create.setText("创建");
        jButton_create.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_createActionPerformed(evt);
            }
        });

        jButton_update.setText("更新");
        jButton_update.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_updateActionPerformed(evt);
            }
        });

        jButton_query.setText("检索");
        jButton_query.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_queryActionPerformed(evt);
            }
        });

        jButton_queryHistory.setText("获取历史信息");
        jButton_queryHistory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_queryHistoryActionPerformed(evt);
            }
        });

        jButton_delete.setText("删除");
        jButton_delete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_deleteActionPerformed(evt);
            }
        });

        jPanel_showXml.setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jTextArea_showXml.setColumns(20);
        jTextArea_showXml.setRows(5);
        jScrollPane2.setViewportView(jTextArea_showXml);

        javax.swing.GroupLayout jPanel_showXmlLayout = new javax.swing.GroupLayout(jPanel_showXml);
        jPanel_showXml.setLayout(jPanel_showXmlLayout);
        jPanel_showXmlLayout.setHorizontalGroup(
            jPanel_showXmlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel_showXmlLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 420, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel_showXmlLayout.setVerticalGroup(
            jPanel_showXmlLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_showXmlLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2)
                .addContainerGap())
        );

        jLabel_url.setText("服务器URL：");

        jTextField_url.setText("http://36.33.216.237:9009/fhir/winningfhir/Patient");

        jComboBox_dataType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "xml", "json" }));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel_url)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jTextField_url, javax.swing.GroupLayout.PREFERRED_SIZE, 547, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(174, 174, 174)
                        .addComponent(jComboBox_dataType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(61, 61, 61)
                                .addComponent(jLabel7))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jButton_create)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_query)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_update)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_queryHistory)
                                .addGap(18, 18, 18)
                                .addComponent(jButton_delete)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel_showXml, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton_create)
                    .addComponent(jButton_query)
                    .addComponent(jButton_queryHistory)
                    .addComponent(jButton_delete)
                    .addComponent(jButton_update))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel_url)
                        .addComponent(jTextField_url, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jComboBox_dataType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel_showXml, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    //创建
    private void jButton_createActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_createActionPerformed
        patientBean = new PatientBean();
        //此处固定值对id存数据库吴影响，只是对于医利捷
        patientBean.setPatientId("001");
        patientBean.setIdCode(this.jTextField_idCode.getText());
        patientBean.setIdNumber(this.jTextField_idNumber.getText());
        patientBean.setSocialCode(this.jTextField_socialCode.getText());
        patientBean.setSocialNumber(this.jTextField_socialNumber.getText());
        
        //姓名
        String patientName = this.jTextField_patientName.getText();
        patientBean.setPatientAllName(patientName);
        patientBean.setPatientFamilyName(patientName.substring(0,1));
        patientBean.setPatientGivenName(patientName.substring(1,patientName.length()));
        
        
        patientBean.setType(this.jComboBox_TeleType.getSelectedItem().toString());
        patientBean.setValue(this.jTextField_TeleValue.getText());
        patientBean.setUse(this.jComboBox_teleUse.getSelectedItem().toString());
        String gender = StringConvertUtil.convertGender( this.jComboBox_gender.getSelectedItem().toString() );
        patientBean.setGender(gender);
       
        //出生日期
        String birthDateTime = this.jTextField_birthDateTime.getText();
        patientBean.setBirthDate(birthDateTime.split(" ")[0]);
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(birthDateTime);
            birthDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+08:00").format(date);
        } catch (ParseException ex) {
            logger.error("error 出生日期 日期转换错误，{}",ex);
        }     
        patientBean.setBirthTime(birthDateTime);
        
        
        //地址
        patientBean.setAddressUse(this.jComboBox_addressUse.getSelectedItem().toString());
        String state = this.jTextField_state.getText();
        String city = this.jTextField_city.getText();
        if(StringUtils.isEmpty(state)) {
            patientBean.setAddressState(city);
        } else {
            patientBean.setAddressState(state);
        }
        city = city +  "市";
        patientBean.setAddressCity(city);
        String district = this.jTextField_district.getText() + "区";
        patientBean.setAddressDistrict(district);
        patientBean.setAddressLine(this.jTextField_line.getText());
        //完整地址
        patientBean.setAddressText(state + city + district + this.jTextField_line.getText() );
        patientBean.setAddressPostalCode(this.jTextField_postalCode.getText());
        
        patientBean.setContactName(this.jTextField_contactName.getText());
        patientBean.setContactRelationship(this.jTextField_relationship.getText());
        patientBean.setContactType(this.jComboBox_contactTeleType.getSelectedItem().toString());
        patientBean.setContactValue(this.jTextField_contactTeleValue.getText());
        String contactGender = StringConvertUtil.convertGender( this.jComboBox_contactGender.getSelectedItem().toString() );
        patientBean.setContactGender(contactGender);
        
        String url = this.jTextField_url.getText();
        String patientString = "";
        String result = "";
        //获取发送数据的类型 xml/json
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        logger.info("url={}",url);
        if ("xml".equals(datatType)) {
            patientString = MakeTempalteStringUtil.makePatientString(patientBean, "/template/patientTemplate.xml");
            patientString = FormatUtil.formatXml(patientString);
            logger.info("创建 patient xml: {}", patientString);
            result = HttpUtil.sendPost(url, patientString, HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
            
        } else if ("json".equals(datatType)){
            patientString = MakeTempalteStringUtil.makePatientString(patientBean, "/template/json/patientTemplate.json");
            logger.info("创建 patient json: {}", patientString);
            result = HttpUtil.sendPost(url, patientString, HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        this.jTextArea_showXml.setText(result);
        logger.info("创建成功");   
        // 创建:
    }//GEN-LAST:event_jButton_createActionPerformed
    //关闭窗口
    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        this.setDefaultCloseOperation(FhirPatientGui.DISPOSE_ON_CLOSE);
        // TODO add your handling code here:
    }//GEN-LAST:event_formWindowClosing
    //清空
    private void jButton_clearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_clearActionPerformed
       this.jTextField_idCode.setText("");
       this.jTextField_idNumber.setText("");
       this.jTextField_socialCode.setText("");
       this.jTextField_socialNumber.setText("");
       this.jTextField_patientName.setText("");
       this.jTextField_TeleValue.setText("");
       this.jTextField_birthDateTime.setText("");
       this.jTextField_state.setText("");
       this.jTextField_city.setText("");
       this.jTextField_district.setText("");
       this.jTextField_line.setText("");
       this.jTextField_postalCode.setText("");
       this.jTextField_contactName.setText("");
       this.jTextField_relationship.setText("");
       this.jTextField_contactTeleValue.setText("");          
        // 清空
    }//GEN-LAST:event_jButton_clearActionPerformed
    //查询
    private void jButton_queryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_queryActionPerformed
//        String url = this.jTextField_url.getText();
//        String patientId = this.jTextField_patientId.getText();
//        String patientName = this.jTextField_patientName.getText();
//        String result = null;
//        if (!StringUtils.isEmpty(patientId)) {
//            //url = url + "/" + patientId;
//            result = HttpUtil.sendGet(url);
//        } else if (!StringUtils.isEmpty(patientName)) {
//            try {   
//                patientName =  java.net.URLEncoder.encode(patientName,"utf-8");
//            } catch (UnsupportedEncodingException ex) {
//                java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(Level.SEVERE, null, ex);
//            }
//            //url = url + "/" + patientName;
//            result = HttpUtil.sendGet(url);
//        }

        String url = this.jTextField_url.getText();
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        String result = null;

        if ("xml".equals(datatType)) {
            result = HttpUtil.sendGet(url,HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if("json".equals(datatType)) {
            result = HttpUtil.sendGet(url,HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
       // logger.info(" url={} result={} ",url, result);
        this.jTextArea_showXml.setText(result);
        //检索
    }//GEN-LAST:event_jButton_queryActionPerformed
    //历史查询
    private void jButton_queryHistoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_queryHistoryActionPerformed
        jButton_queryActionPerformed(evt);
        
//        String url = this.jTextField_url.getText();
//        //String patientId = this.jTextField_patientId.getText();
//        String result = null;
////        if (!StringUtils.isEmpty(patientId)) {
////            //url = url + "/" + patientId;
////            result = HttpUtil.sendGet(url);
////        }
//        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
//        result = HttpUtil.sendGet(url);
//        
//        if (!StringUtils.isEmpty(result)) {
//            if ("xml".equals(datatType)) {
//                result = FormatXmlUtil.formatXml(result);
//            } else if("json".equals(datatType)) {
//                 result = FormatJsonUtil.formatJson(result);
//            }
//            logger.info("query url result {} ", result);
//             this.jTextArea_showXml.setText(result);
//        }else{
//            this.jTextArea_showXml.setText("查询结果为空");
//        }
        // 获取历史版本
    }//GEN-LAST:event_jButton_queryHistoryActionPerformed
    //删除
    private void jButton_deleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_deleteActionPerformed
//        jButton_queryActionPerformed(evt);
//        String url = this.jTextField_url.getText().trim();
//        String patientId = this.jTextField_patientId.getText().trim();
//
//        if (!StringUtils.isEmpty(patientId)) {
//            //url = url + "/" + patientId;
//            HttpUtil.sendGet(url);
//            this.jTextArea_showXml.setText("删除成功");
//        }        
        String url = this.jTextField_url.getText().trim();
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        String result = null;

        if ("xml".equals(datatType)) {
            result = HttpUtil.sendDelete(url,HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if("json".equals(datatType)) {
            result = HttpUtil.sendDelete(url,HttpUtil.ContentType_json);
             result = FormatUtil.formatJson(result);
        }
        logger.info("delete url result {} ", result);
        this.jTextArea_showXml.setText(result);
        // 删除
    }//GEN-LAST:event_jButton_deleteActionPerformed
    //更新
    private void jButton_updateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_updateActionPerformed
        patientBean = new PatientBean();
        patientBean.setPatientId(this.jTextField_patientId.getText());
        patientBean.setIdCode(this.jTextField_idCode.getText());
        patientBean.setIdNumber(this.jTextField_idNumber.getText());
        patientBean.setSocialCode(this.jTextField_socialCode.getText());
        patientBean.setSocialNumber(this.jTextField_socialNumber.getText());
        
        //姓名
        String patientName = this.jTextField_patientName.getText();
        patientBean.setPatientAllName(patientName);
        patientBean.setPatientFamilyName(patientName.substring(0,1));
        patientBean.setPatientGivenName(patientName.substring(1,patientName.length()));
 
        patientBean.setType(this.jComboBox_TeleType.getSelectedItem().toString());
        patientBean.setValue(this.jTextField_TeleValue.getText());
        patientBean.setUse(this.jComboBox_teleUse.getSelectedItem().toString());
        String gender = StringConvertUtil.convertGender( this.jComboBox_gender.getSelectedItem().toString() );
        patientBean.setGender(gender);
       
        //出生日期
        String birthDateTime = this.jTextField_birthDateTime.getText();
        patientBean.setBirthDate(birthDateTime.split(" ")[0]);
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(birthDateTime);
            birthDateTime = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss+08:00").format(date);
        } catch (ParseException ex) {
            logger.error("data parse error : {} ", ex);
        }     
        patientBean.setBirthTime(birthDateTime);

        //地址
        patientBean.setAddressUse(this.jComboBox_addressUse.getSelectedItem().toString());
        String state = this.jTextField_state.getText();
        String city = this.jTextField_city.getText();
        if(StringUtils.isEmpty(state)) {
            patientBean.setAddressState(city);
        } else {
            patientBean.setAddressState(state);
        }
        city = city +  "市";
        patientBean.setAddressCity(city);
        String district = this.jTextField_district.getText() + "区";
        patientBean.setAddressDistrict(district);
        patientBean.setAddressLine(this.jTextField_line.getText());
        //完整地址
        patientBean.setAddressText(state + city + district + this.jTextField_line.getText() );
        patientBean.setAddressPostalCode(this.jTextField_postalCode.getText());
        
        patientBean.setContactName(this.jTextField_contactName.getText());
        patientBean.setContactRelationship(this.jTextField_relationship.getText());
        patientBean.setContactType(this.jComboBox_contactTeleType.getSelectedItem().toString());
        patientBean.setContactValue(this.jTextField_contactTeleValue.getText());
        String contactGender = StringConvertUtil.convertGender( this.jComboBox_contactGender.getSelectedItem().toString() );
        patientBean.setContactGender(contactGender);

        String url = this.jTextField_url.getText();
        String patientString = "";
        String result = "";
        //获取发送数据的类型 xml/json
        String datatType = this.jComboBox_dataType.getSelectedItem().toString();
        if ("xml".equals(datatType)) {
            patientString = MakeTempalteStringUtil.makePatientString(patientBean, "/template/patientTemplate.xml");
            patientString = FormatUtil.formatXml(patientString);
            logger.info("更新 patient xml: {}", patientString);
            result = HttpUtil.sendPut(url, patientString, HttpUtil.ContentType_xml);
            result = FormatUtil.formatXml(result);
        } else if ("json".equals(datatType)){
            patientString = MakeTempalteStringUtil.makePatientString(patientBean, "/template/json/patientTemplate.json");
            logger.info("更新 patient json: {}", patientString);
            result = HttpUtil.sendPut(url, patientString, HttpUtil.ContentType_json);
            result = FormatUtil.formatJson(result);
        }
        
//        String patientXml = MakeXmlUtil.makePatientXml(patientBean);
//        patientXml = FormatXmlUtil.formatXml(patientXml);
//        logger.info("更新 patientXml: {}", patientXml);
//        
//        String url = this.jTextField_url.getText();      
//        String result =  HttpUtil.sendPut(url, patientXml); 
        
            //result = FormatXmlUtil.formatXml(result);
          this.jTextArea_showXml.setText(result);
          logger.info("更新成功");
        // 更新
    }//GEN-LAST:event_jButton_updateActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FhirPatientGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FhirPatientGui().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton_clear;
    private javax.swing.JButton jButton_create;
    private javax.swing.JButton jButton_delete;
    private javax.swing.JButton jButton_query;
    private javax.swing.JButton jButton_queryHistory;
    private javax.swing.JButton jButton_update;
    private javax.swing.JComboBox<String> jComboBox_TeleType;
    private javax.swing.JComboBox<String> jComboBox_addressUse;
    private javax.swing.JComboBox<String> jComboBox_contactGender;
    private javax.swing.JComboBox<String> jComboBox_contactTeleType;
    private javax.swing.JComboBox<String> jComboBox_dataType;
    private javax.swing.JComboBox<String> jComboBox_gender;
    private javax.swing.JComboBox<String> jComboBox_teleUse;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel_TeleType;
    private javax.swing.JLabel jLabel_TeleValue;
    private javax.swing.JLabel jLabel_address;
    private javax.swing.JLabel jLabel_addressUse;
    private javax.swing.JLabel jLabel_birthDate;
    private javax.swing.JLabel jLabel_city;
    private javax.swing.JLabel jLabel_contactGender;
    private javax.swing.JLabel jLabel_contactName;
    private javax.swing.JLabel jLabel_contactTeleType;
    private javax.swing.JLabel jLabel_contactTeleValue;
    private javax.swing.JLabel jLabel_district;
    private javax.swing.JLabel jLabel_gender;
    private javax.swing.JLabel jLabel_idCode;
    private javax.swing.JLabel jLabel_idNumber;
    private javax.swing.JLabel jLabel_line;
    private javax.swing.JLabel jLabel_patientId;
    private javax.swing.JLabel jLabel_patientName;
    private javax.swing.JLabel jLabel_postalCode;
    private javax.swing.JLabel jLabel_relationship;
    private javax.swing.JLabel jLabel_socialCode;
    private javax.swing.JLabel jLabel_socialNumber;
    private javax.swing.JLabel jLabel_state;
    private javax.swing.JLabel jLabel_teleUse;
    private javax.swing.JLabel jLabel_url;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel_showXml;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextArea jTextArea_showXml;
    private javax.swing.JTextField jTextField_TeleValue;
    private javax.swing.JTextField jTextField_birthDateTime;
    private javax.swing.JTextField jTextField_city;
    private javax.swing.JTextField jTextField_contactName;
    private javax.swing.JTextField jTextField_contactTeleValue;
    private javax.swing.JTextField jTextField_district;
    private javax.swing.JTextField jTextField_idCode;
    private javax.swing.JTextField jTextField_idNumber;
    private javax.swing.JTextField jTextField_line;
    private javax.swing.JTextField jTextField_patientId;
    private javax.swing.JTextField jTextField_patientName;
    private javax.swing.JTextField jTextField_postalCode;
    private javax.swing.JTextField jTextField_relationship;
    private javax.swing.JTextField jTextField_socialCode;
    private javax.swing.JTextField jTextField_socialNumber;
    private javax.swing.JTextField jTextField_state;
    private javax.swing.JTextField jTextField_url;
    // End of variables declaration//GEN-END:variables
}
